package com.xsm.function;

import java.util.ArrayList;

import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

import com.xsm.internet.PostMessage;
import com.xsm.object.UpdateObject;

public class AskForResult {
	
	
public UpdateObject getTableVersion(){
	 UpdateObject object=new UpdateObject();
	 ArrayList params=new ArrayList();	
	 params.add(new BasicNameValuePair("ASK","GetTableVersion"));
	 PostMessage	postMessage=new PostMessage(params);
	 String re=postMessage.getResult();
	 try {
		JSONObject jobject=new JSONObject(re);
     	String authorv=jobject.getString("author");
     	String pressv=jobject.getString("press");
      	String booknamev=jobject.getString("bookname");
      	String recommendv=jobject.getString("recommend");
      	String textbookav=jobject.getString("textbooka");
      	String textbookbv=jobject.getString("textbookb");
    	String textbookcv=jobject.getString("textbookc");
    	object.setAuthorv(authorv);
    	object.setBooknamev(booknamev);
    	object.setPressv(pressv);
    	object.setRecommendv(recommendv);
    	object.setTextbookav(textbookav);
    	object.setTextbookbv(textbookbv);
    	object.setTextbookcv(textbookcv);
	 } catch (Exception e) {
		Log.d("my", e+"");
	 }
	 return object;
}

}
